//
//  ViewController.m
//  UdeskSDK-iOS
//
//  Created by HaKim on 16/8/17.
//  Copyright © 2016年 haKim. All rights reserved.
//

#import "ViewController.h"

#import "Udesk.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)contactWithKefu:(UIButton *)sender {
    NSDictionary *parameters = @{
                                 @"user": @{
                                         @"nick_name": @"小明",
                                         @"cellphone":@"18888888888",
                                         @"email":@"xiaoming@qq.com",
                                         @"description":@"用户描述",
                                         @"sdk_token":@"xxxxxxxxxxx"
                                         }
                                 };
    
    [UdeskManager createCustomerWithCustomerInfo:parameters];
    
    [UdeskManager requestRandomAgent:^(id responseObject, NSError *error) {
        
        //返回客服信息
        
        NSLog(@"responseObject = %@",responseObject);
    }];
    
    
    UdeskChatViewController *chat = [[UdeskChatViewController alloc] init];
    
    [self.navigationController pushViewController:chat animated:YES];
}

@end
